<template>
  <div class="auctionulCon">
    <div class="auctionul" v-for="(v,i) in auctionUlList" :key="i+'a'" >
      <div class="auctionul_goodsInfo" v-if="!v.jfGoodsExchangeId" @click="_skipDetail(v.state, v.goodsSkuId, 0)">
        <div class="img">
          <img class="auction_goodsImg" :src="v.goodsLogo" alt="">
        </div>
        <div class="auction_goodstext">
          <span class="auction_goodsTitle">{{v.goodsName}}</span>
          <div class="auction_goodsPrice">
              <span>成交价：
                  <span class="auction_dealPrice">￥{{v.goodsPrice}}</span>
              </span>
            <span class="marketPrice">市场价：
                <span>￥{{v.marketRetailPrice}}</span>
            </span>
          </div>
          <span class="auction_dealTime">成交时间：
              <span>{{v.createTime | formatDate}}</span>
          </span>
        </div>
      </div>
      <div class="auctionul_goodsInfo" v-else @click="_skipDetail(v.state, v.jfGoodsExchangeId, 1)">
        <div class="img">
          <img class="auction_goodsImg" :src="v.jfGoodsLogo" alt="">
        </div>
        <div class="auction_goodstext">
          <span class="auction_goodsTitle">{{v.jfGoodsName + v.jfGoodsType}}</span>
          <div class="auction_goodsPrice">
              <span>积分：
                  <span class="auction_dealPrice">￥{{v.jfNeedIntegral}}</span>
              </span>
            <span class="marketPrice">市场价：
                <span>￥{{v.jfMarketRetailPrice}}</span>
            </span>
          </div>
          <span class="auction_dealTime">成交时间：
              <span>{{v.createTime | formatDate}}</span>
          </span>
        </div>
      </div>
      <div class="auctionul_othercon">

        <!-- 待发货 -->
        <span class="auctionIng" v-if="v.state === -1">等待商家发货</span>

        <!-- 已发货 -->
        <div class="auction_btn1" @click="_skipLogistics(v.id)" v-if="v.state === 0">
          <span>查看物流</span>
        </div>
        <!--<div class="auction_btn2" v-if="v.state === 0">-->
          <!--<span>确认签收</span>-->
        <!--</div>-->

        <!-- 已完成 -->
        <span class="auctionIng" v-if="v.state === 3">已签收</span>
      </div>
    </div>

  </div>
</template>

<script>
  import g3 from '@imgs/home/goods/g3.png'
  import { formatDate } from '@js/formatDate.js'

  export default {
    name: 'auctionul',
    data() {
      return {
        imc: g3,
      }
    },
    props: {
      auctionUlList: {
        type: Array,
        default: '',
      },
    },
    components: {},

    computed: {},

    methods: {
      _skipLogistics(id) {
        this.$router.push({
          name: 'Logistics',
          path: '/logistics',
          params: {
            id: id,
          },
        })
      },
      // 跳转
      _skipDetail(state, goodId, type) {
        if (state === -1) {
          if (type === 0) {
            this.$router.push({
              path: 'dealDetail',
              name: 'DealDetail',
              query: {
                id: goodId,
              },
            })
          } else {
            this.$router.push({
              path: 'IntegralDetail',
              name: 'IntegralDetail',
              query: {
                id: goodId,
              },
            })
          }
        }
      },
    },

    mounted() {
    },

    filters: {
      formatDate(time) {
        let date = new Date(time)
        return formatDate(date, 'yyyy/MM/dd hh:mm:ss')
      },
    },
  }
</script>
